<?php

namespace app\modules\clinical\models;

use Yii;

/**
 * This is the model class for table "excel_cmt".
 *
 * @property integer $pk_id
 * @property integer $pt_age
 * @property string $pt_history
 * @property integer $bd_jixing
 * @property integer $bd_weisuo_l
 * @property integer $bd_weisuo_r
 * @property integer $bd_jili_lu
 * @property integer $bd_jili_ld
 * @property integer $bd_jili_ru
 * @property integer $bd_jili_rd
 * @property integer $bd_fanshe_xi
 * @property integer $bd_fanshe_gen
 * @property integer $bd_fanshe_gong
 * @property integer $bd_fanshe_rao
 * @property integer $bd_zhangai
 * @property string $bd_shenjing
 * @property string $bd_butai
 * @property integer $bd_romberg
 * @property integer $bd_gongji
 * @property integer $bd_bingfa
 * @property integer $bd_else_yanji
 * @property integer $bd_else_shi
 * @property integer $bd_else_yanzh
 */
class ExcelCmt extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'excel_cmt';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pt_age', 'bd_jixing', 'bd_weisuo_l', 'bd_weisuo_r', 'bd_jili_lu', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_fanshe_xi', 'bd_fanshe_gen', 'bd_fanshe_gong', 'bd_fanshe_rao', 'bd_zhangai', 'bd_romberg', 'bd_gongji', 'bd_bingfa', 'bd_else_yanji', 'bd_else_shi', 'bd_else_yanzh'], 'required'],
            [['pt_age', 'bd_jixing', 'bd_weisuo_l', 'bd_weisuo_r', 'bd_jili_lu', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_fanshe_xi', 'bd_fanshe_gen', 'bd_fanshe_gong', 'bd_fanshe_rao', 'bd_zhangai', 'bd_romberg', 'bd_gongji', 'bd_bingfa', 'bd_else_yanji', 'bd_else_shi', 'bd_else_yanzh'], 'integer'],
            [['pt_history', 'bd_shenjing', 'bd_butai'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'pk_id' => 'Pk ID',
            'pt_age' => '发病年龄',
            'pt_history' => '现病史',
            'bd_jixing' => '畸形：弓形足',
            'bd_weisuo_l' => '左侧',
            'bd_weisuo_r' => '右侧',
            'bd_jili_lu' => '左上肢',
            'bd_jili_ld' => '左下肢',
            'bd_jili_ru' => '右上肢',
            'bd_jili_rd' => '右下肢',
            'bd_fanshe_xi' => '膝反射',
            'bd_fanshe_gen' => '跟腱反射',
            'bd_fanshe_gong' => '肱二头肌反射',
            'bd_fanshe_rao' => '绕反射',
            'bd_zhangai' => '感觉障碍',
            'bd_shenjing' => '植物神经功能',
            'bd_butai' => '步态',
            'bd_romberg' => 'Romberg征',
            'bd_gongji' => '共济运动',
            'bd_bingfa' => '并发：心脏',
            'bd_else_yanji' => '眼疾麻痹',
            'bd_else_shi' => '视神经萎缩',
            'bd_else_yanzh' => '眼震',
        ];
    }

    public function defaultValue()
    {
        return ;
    }

    public static function getParams($type = false, $code = false)
    {
        $params = [
            'jianfan' => ['0', '+', '++', '+++', '++++'],
            'youwu' => ['1' => '有', '0' => '无'],
        ];

        if ($code !== false) {
            return ($type) ? $params[$type][$code] : '';
        }

        return ($type) ? $params[$type] : $params;
    }
}
